package com.madou.dbtool.mysql.test;

import com.madou.dbtool.common.enums.DBEnum;
import com.madou.dbtool.common.icon.AllIcons;
import com.madou.dbtool.common.messages.DBToolBundle;
import com.madou.dbtool.relationship.frame.BaseDBToolFrame;
import com.madou.dbtool.ui.toolbar.LafUtil;

import javax.swing.*;
import java.awt.*;

/**
 * 数据库界面入口类
 */
public class MysqlDBToolFrame extends BaseDBToolFrame {


    public static void main(String[] args) throws Exception {
        System.setProperty("awt.useSystemAAFontSettings", "on");
        System.setProperty("swing.aatext", "true");
        LafUtil.initLaf(args);
//        UIManager.setLookAndFeel("com.jtattoo.plaf.smart.SmartLookAndFeel");
//        String name = IdeaSkinLookAndFeel.class.getName();
//        UIManager.setLookAndFeel(name);
        MysqlDBToolFrame dbToolFrame = new MysqlDBToolFrame();
        dbToolFrame.installThemeAndInit();
        Insets screenInsets = Toolkit.getDefaultToolkit().getScreenInsets(dbToolFrame.getGraphicsConfiguration());
        Rectangle bounds = dbToolFrame.getGraphicsConfiguration().getBounds();
        int height = bounds.height-screenInsets.bottom-screenInsets.top;
        dbToolFrame.setBounds(new Rectangle(screenInsets.left,screenInsets.top,bounds.width,height));
        dbToolFrame.setSize(new Dimension(bounds.width,height));
        dbToolFrame.setPreferredSize(new Dimension(bounds.width,height));
        dbToolFrame.setMaximumSize(new Dimension(bounds.width,height));
        dbToolFrame.setTitle(DBToolBundle.message("mysql.title"));
        dbToolFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        dbToolFrame.setIconImage(AllIcons.Windows.MYSQL_ICON);
        dbToolFrame.setVisible(true);
        dbToolFrame.pack();
        dbToolFrame.setExtendedState(Frame.MAXIMIZED_BOTH);
    }

    @Override
    public void initEditorLanguange() {
    }

    @Override
    public DBEnum getDBEnum() {
        return DBEnum.MYSQL;
    }
}
